#define _CRT_SECURE_NO_WARNINGS 1
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl '\n'
const int N = 1010;
int n, d;
bool vis[N];

struct node {
    double x, y;
    int f;
}a[N];

void dfs(int dep) {
    if (vis[dep]) return;
    vis[dep] = true;
    for (int i = 1; i <= n; i++) {
        double s = sqrt(pow(a[i].x - a[dep].x, 2) + pow(a[i].y - a[dep].y, 2));
        if (s > d) continue;
        a[i].f = 1;
        dfs(i);
    }
}

int main() {
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i].x >> a[i].y;
    cin >> d;
    dfs(1);
    for (int i = 1; i <= n; i++) cout << a[i].f << endl;
    return 0;
}